package org.example.CAS;

import java.util.concurrent.atomic.AtomicInteger;

public class cas {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(2021);

        atomicInteger.compareAndSet(2021,6666);
        atomicInteger.compareAndSet(6666,6667);
        atomicInteger.compareAndSet(6667,2021);

        atomicInteger.compareAndSet(2021,6666);

        int i = atomicInteger.get();
        System.out.println(i);
        System.out.println((44000 + 45000 + 44600 + 44000 + 44000 + 44000));
    }
}
